package com.hui.security.log.service.impl;

import com.hui.security.log.entity.OperatorLog;
import com.hui.security.log.mapper.OperatorLogMapper;
import com.hui.security.log.service.OperatorLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <b><code>OperatorLogServiceImpl</code></b>
 * <p/>
 * Description:
 * <p/>
 * <b>Creation Time:</b> 2019/1/16 0:05.
 *
 * @author HuWeihui
 */
@Service
public class OperatorLogServiceImpl implements OperatorLogService {

    @Autowired
    private OperatorLogMapper operatorLogMapper;
    /**
     * 新增操作日志.
     *
     * @param operatorLog the operator log
     * @return the operator log
     * @author : Hu weihui
     * @since nile -cmszbs-szcst 0.1.0
     */
    @Override
    public OperatorLog add(OperatorLog operatorLog) {
        operatorLogMapper.insertSelective(operatorLog);
        return operatorLog;
    }

    /**
     * 删除操作日志.
     *
     * @param logId the log id
     * @author : Hu weihui
     * @since nile -cmszbs-szcst 0.1.0
     */
    @Override
    public void delete(String logId) {
        operatorLogMapper.deleteByPrimaryKey(logId);
    }
}
